
#include "ffconf.h"
#include <stm32f10x_lib.h>
#include "ff.h"

int ff_cre_syncobj (BYTE data, _SYNC_t* sync) // Create a sync object
{
	* sync = OSMboxCreate((void *)1);	

	return 1;
}


int ff_del_syncobj (_SYNC_t sync)		/* Delete a sync object */
{
	return 1;
}

int ff_req_grant (_SYNC_t sync)			/* Lock sync object */
{
	u8 err;
	
	OSMboxPend(sync, _FS_TIMEOUT, &err); 

	if(err == OS_ERR_NONE)
		return 1;
	else
		return 0;
}

void ff_rel_grant (_SYNC_t sync)		/* Unlock sync object */
{
	OSMboxPost(sync, (void*)1);		 
}
